/*
  This file is part of 'Trivial chess'.

  'Trivial chess' is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  'Trivial chess' is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with 'Trivial chess'.  If not, see <http://www.gnu.org/licenses/>.
*/

/* SVN FILE: $Id$ */
/**
 * @author         $Author$
 * @version        $Rev$
 * @lastrevision   $Date$
 * @filesource     $URL$
 */

#ifndef MOVECOM_H
#define MOVECOM_H

#include "MoveAbstract.h"

template<class B>
class MoveCom
	: public MoveAbstract<MoveCom, B> {
public:
	MoveCom<B>() {}

	MoveCom<B>(const std::string str) { this->me().fromStr(str); }

	MoveCom<B>(const Square from, const Square to, const Piece promoted = Piece::NIL())
		: _from(from), _to(to), _promoted(promoted) {}

	Square from() const { return this->_from; }
	Square to() const { return this->_to; }
	Piece promoted() const { return this->_promoted; }

	void setFrom(const Square from) { this->_from = from; }
	void setTo(const Square to) { this->_to = to; }
	void setPromoted(const Piece promoted) { this->_promoted = promoted; }
private:
	Square _from;
	Square _to;
	Piece _promoted;
};

#endif /* MOVECOM_H */
